﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Connections.aspx.cs" Inherits="MyVocationSpace.Connections" %>

<%@ Register Src="Header.ascx" TagName="header" TagPrefix="uc" %>
<%@ Register Src="Footer.ascx" TagName="footer" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>..:: MY VocationSpace ::..</title>
    <link href="css/Default.css" rel="stylesheet" type="text/css" />
    <script src="js/jquery-1.7.1.min.js" type="text/javascript"></script>
    <link href="css/jquery-ui.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        function SendConnectionReq(id, spnsentMsgTick, spnsentMsg, spanMYConnection, lnkConnectSend) {            //alert(id);
            var xmlhttp;
            if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
                xmlhttp = new XMLHttpRequest();
            }
            else {// code for IE6, IE5
                xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            xmlhttp.onreadystatechange = function () {
                if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
                    document.getElementById("loading").style.display = "none";
                    document.getElementById(spnsentMsgTick).style.display = "block";
                    document.getElementById(spnsentMsg).innerHTML = "Connection sent successfully";
                    document.getElementById(spanMYConnection).style.display = "none";
                    document.getElementById(lnkConnectSend).style.display = "none";

                    //spn.innerHTML = xmlhttp.responseText;
                    //spn.style.display = "block";
                    //emailAdd.value = "YOUR EMAIL ADDRESS";
                }
            }
            xmlhttp.open("POST", "AJAX/UserConnectRequestSend.aspx?IDConnect=" + id, true);
            xmlhttp.send();
            document.getElementById("loading").style.display = "block";

        }
        
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <center>
        <div>
            <uc:header ID="header" runat="server" />
        </div>
        <div id="content-wrapper">
            <center>
                <div class="Content">
                    <div style="background-color: #F4F4F4">
                        <div class="profile-header">
                            <img id="idImg" alt="MyPic" runat="server" /><%--ViewProfile.aspx?IDUser=<%#Eval("IDUser")%>--%>
                            <div class="personal-detail">
                                <div class="detail">
                                    <span id="username" runat="server"></span>
                                </div>
                                <div class="OccuOrg">
                                    <span id="Occu" style="margin-right: 5px;" runat="server"></span><span style="margin-right: 5px;">
                                        at</span><span id="org" style="margin-right: 5px;" runat="server"></span>
                                </div>
                                <div class="cityConInd">
                                    <span id="city" runat="server"></span><span>,</span> <span id="country" runat="server">
                                    </span><span style="margin-left: 5px;">|</span> <span id="industry" runat="server">
                                    </span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="user-connections" style="padding-top:150px">
                        <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="upuserConnection">
                            <ProgressTemplate>
                                <div id="pageLoading">
                                    <center>
                                        <div style="color:#1C6F93; font-size: 18px; top: 50%; left: 50%;">
                                            Loading...
                                        </div>
                                    </center>
                                    <div id="transparentBg" class="transparentBg">
                                    </div>
                                </div>
                            </ProgressTemplate>
                        </asp:UpdateProgress>
                        <asp:UpdatePanel runat="server" ID="upuserConnection">
                            <ContentTemplate>
                                <table width="900px">
                                    <tr>
                                        <td align="left" style="font-family: Arial; padding-top: 30px; font-size: 18px">
                                            <asp:Label ID="lblName" runat="server" Font-Names="Arial" Font-Italic="true" Font-Bold="true"></asp:Label>
                                            <span>'s</span> Connection
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="left" style="font-size: 15px" class="head-lightBar">
                                            All Connections
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 800px">
                                            <asp:DataList ID="dlUserConnection" RepeatDirection="Vertical" DataKeyField="IDUser"
                                                runat="server" OnItemDataBound="dlUserConnection_ItemDataBound">
                                                <ItemTemplate>
                                                    <table width="800px" class="light-dark" style="margin-left: 8px" border="0">
                                                        <tr>
                                                            <td valign="top">
                                                                <table width="800px">
                                                                    <tr>
                                                                        <td style="padding-right: 10px">
                                                                            <img src='<%# Eval("Photo")%>' runat="server" id="imgPerson" width="60" height="60"
                                                                                style="padding: 4px;" />
                                                                        </td>
                                                                        <td valign="top" align="left" style="width: 800px;">
                                                                            <table>
                                                                                <tr>
                                                                                    <td align="left" style="font-size: 15px; width: 400px; font-weight: bold">
                                                                                        <a href="ViewProfile.aspx?IDUser=<%#Eval("IDUser")%>"><span style="font-family: Arial">
                                                                                            <%#Eval("Firstname")%></span>&nbsp;<span style="font-family: Arial"><%#Eval("Lastname")%></span></a><span><input
                                                                                                type="hidden" id="hiddenIDConnectionStatus" runat="server" value='<%#Eval("IDConnectionStatus")%>' /></span></td>
                                                                                    <td style="padding-left: 140px;" align="right">
                                                                                        <span id="spanMYConnection" runat="server">
                                                                                            <img src="Images/plus1.jpg" id="imgPlus" runat="server" style="vertical-align: top"
                                                                                                height="14" width="14" />
                                                                                        </span><span style="vertical-align: top; margin-left: -4px; color: #006699; font-weight: bold;">
                                                                                            <asp:LinkButton ID="lnkConnectSend" ForeColor="#006699" runat="server" CommandArgument='<%#Eval("IDUser")%>'
                                                                                                OnClick="lnkConnectSend_Click">Connect</asp:LinkButton></span>
                                                                                        <div style="float: left; width:100px; padding-left: 5px">
                                                                                            <span><span id="spnsentMsg" style="color: #7BBC23; font-family: Arial; font-weight: bold;
                                                                                                font-size: 12px" runat="server"></span><span id="idsuccesstick" runat="server" visible="false"
                                                                                                    style="text-align: left">
                                                                                                    <img src="Images/tick1.jpg" width="14" style="vertical-align: top" height="14" /></span>
                                                                                                <span id="spanSuccessMsg" runat="server"></span></span>
                                                                                        </div>
                                                                                        <%--<span id="spnsentMsgTick" runat="server"style="text-align: left; display:none;">
                                                                                                <img src="Images/tick1.jpg" width="14" style="vertical-align: top" height="14" /></span>--%>
                                                                                    </td>
                                                                                </tr>
                                                                                <tr>
                                                                                    <td style="font-size: 13px; margin-top: -50px; color: #000">
                                                                                        <span style="font-family: Arial">
                                                                                            <%#Eval("CurrentPosition")%></span><span style="padding: 0px 3px; font-family: Arial">at</span><span
                                                                                                style="font-family: Arial"><%#Eval("Orgnization")%></span></td>
                                                                                    <td>
                                                                                    </td>
                                                                                </tr>
                                                                                <tr>
                                                                                    <td style="font-size: 13px; color: Gray">
                                                                                        <span style="font-family: Arial">
                                                                                            <%#Eval("City")%></span><span>,</span><span style="padding-left: 3px; font-family: Arial"><%#Eval("CountryName")%></span></td>
                                                                                    <td>
                                                                                    </td>
                                                                                </tr>
                                                                            </table>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td align="left" colspan="2">
                                                                            <hr style="width: 900px; text-align: left; border: 1px dashed #D6D6D6;" />
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </ItemTemplate>
                                            </asp:DataList>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div>
                                                <div style="width: 100px; text-align: left; float: left">
                                                    <asp:LinkButton ID="lnkPre" runat="server" Font-Size="13px" ForeColor="#FD403E" Font-Bold="true"
                                                        OnClick="lnkPre_Click">Pre</asp:LinkButton>&nbsp;&nbsp;&nbsp;
                                                    <asp:LinkButton ID="lnkNext" runat="server" Font-Size="13px" ForeColor="#FD403E"
                                                        Font-Bold="true" OnClick="lnkNext_Click">Next</asp:LinkButton></div>
                                                <div style="width: 800px; vertical-align: top; text-align: right; float: left">
                                                    <asp:Label ID="Label1" runat="server" Text="" ForeColor="#545454" Font-Names="Arial"></asp:Label><br />
                                                    <asp:Label ID="Label2" runat="server" Text="" ForeColor="#545454" Font-Size="12px"></asp:Label></div>
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </div>
                </div>
            </center>
        </div>
        <div style="clear: both">
        </div>
        <div>
            <uc1:footer runat="server" ID="footer"></uc1:footer>
        </div>
    </center>
    </form>
</body>
</html>
